<?php 
		if(!isset($surl)){$surl = "";}
		$numrows = $con->total_records($numsearch);
		$maxPage = ceil($numrows/$rowsPerPage);
		$self = $_SERVER['PHP_SELF'];
		if ($pageNum > 1)
		{
			$ppage = $pageNum - 1;
			$first = "<a href=\"$self?p=1$surl\" title=\"First Page\">&laquo; First</a>";
			$prev = "<a href=\"$self?p=$ppage$surl\" title=\"Previous Page\">&laquo; Previous</a>";
		} 
		else
		{
			$first = "";
			$prev = "";
		}
		
		if ($pageNum < $maxPage)
		{
			$ppage = $pageNum + 1;
			$next = "<a href=\"$self?p=$ppage$surl\" title=\"Next Page\">Next &raquo;</a>";
			$last = "<a href=\"$self?p=$maxPage$surl\" title=\"Last Page\">Last &raquo;</a>";
		} 
		else
		{
			$next = "";
			$last = "";
		}
		
		$pagenos = "<select id='pgn' name='pgn' class='pgn' onchange=\"window.location=this.value;\">";
			for($a = 1;$a<=$maxPage;$a++)
			{
				if($a == $pageNum) {$c = "selected=\"selected\"";} else {$c = "";}
				$pagenos .=  "<option value='$self?p=$a$surl' $c>$a &nbsp;</option>\n";
			}
		$pagenos .= "</select>";	
        ?>